package labox.innovation.gameserver.network.gameserverpackets;

import java.io.IOException;

public class AuthRequest extends GameServerBasePacket {
	/**
	 * 
	 * @param id
	 *            游戏服务器请求的ID
	 * @param acceptAlternate
	 *            是否接受登陆服务器的ID修改
	 * @param externalHost
	 *            主机名
	 * @param externalIP
	 *            外部IP
	 * @param internalIP
	 *            内部IP
	 * @param port
	 *            端口
	 * @param maxplayer
	 *            最大承载的玩家数量
	 * @param type
	 *            游戏服务器类型
	 */
	public AuthRequest(int id, boolean acceptAlternate, String externalHost, String externalIP, String internalIP, int port, int maxplayer,int type) {
		writeByte(0x01);
		writeByte(id);
		writeByte(acceptAlternate ? 0x01 : 0x00);
		writeString(externalHost);
		writeString(externalIP);
		writeString(internalIP);
		writeShort(port);
		writeInt(maxplayer);
		writeInt(type);
	}

	/* (non-Javadoc)
	 * @see net.sf.l2j.gameserver.gameserverpackets.GameServerBasePacket#getContent()
	 */
	@Override
	public byte[] getContent() throws IOException {
		return getBytes();
	}

}